package pe.gob.sunarp.entidad;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the TA_CTTE_RMC database table.
 * 
 */
@Embeddable
public class TaCtteRmcPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;
	private String coRegiOrig;
	private String coSedeOrig;
	private String anTitu;
	private long noTitu;
	private String fgTituExpe;
	private long nsCtte;

    public TaCtteRmcPK() {
    }

	@Column(name="CO_REGI_ORIG", unique=true, nullable=false, length=2)
	public String getCoRegiOrig() {
		return this.coRegiOrig;
	}
	public void setCoRegiOrig(String coRegiOrig) {
		this.coRegiOrig = coRegiOrig;
	}

	@Column(name="CO_SEDE_ORIG", unique=true, nullable=false, length=2)
	public String getCoSedeOrig() {
		return this.coSedeOrig;
	}
	public void setCoSedeOrig(String coSedeOrig) {
		this.coSedeOrig = coSedeOrig;
	}

	@Column(name="AN_TITU", unique=true, nullable=false, length=4)
	public String getAnTitu() {
		return this.anTitu;
	}
	public void setAnTitu(String anTitu) {
		this.anTitu = anTitu;
	}

	@Column(name="NO_TITU", unique=true, nullable=false, precision=8)
	public long getNoTitu() {
		return this.noTitu;
	}
	public void setNoTitu(long noTitu) {
		this.noTitu = noTitu;
	}

	@Column(name="FG_TITU_EXPE", unique=true, nullable=false, length=1)
	public String getFgTituExpe() {
		return this.fgTituExpe;
	}
	public void setFgTituExpe(String fgTituExpe) {
		this.fgTituExpe = fgTituExpe;
	}

	@Column(name="NS_CTTE", unique=true, nullable=false, precision=3)
	public long getNsCtte() {
		return this.nsCtte;
	}
	public void setNsCtte(long nsCtte) {
		this.nsCtte = nsCtte;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof TaCtteRmcPK)) {
			return false;
		}
		TaCtteRmcPK castOther = (TaCtteRmcPK)other;
		return 
			this.coRegiOrig.equals(castOther.coRegiOrig)
			&& this.coSedeOrig.equals(castOther.coSedeOrig)
			&& this.anTitu.equals(castOther.anTitu)
			&& (this.noTitu == castOther.noTitu)
			&& this.fgTituExpe.equals(castOther.fgTituExpe)
			&& (this.nsCtte == castOther.nsCtte);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.coRegiOrig.hashCode();
		hash = hash * prime + this.coSedeOrig.hashCode();
		hash = hash * prime + this.anTitu.hashCode();
		hash = hash * prime + ((int) (this.noTitu ^ (this.noTitu >>> 32)));
		hash = hash * prime + this.fgTituExpe.hashCode();
		hash = hash * prime + ((int) (this.nsCtte ^ (this.nsCtte >>> 32)));
		
		return hash;
    }
}